package com.sds.shop.action;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.sds.fw.mvc.Action;
import com.sds.fw.mvc.HttpUtil;
import com.sds.shop.dao.MemDAO;
import com.sds.shop.vo.MemVO;
import com.sds.shop.vo.SessionVO;

public class FinalModifyMemAction extends Action {

	@Override
	public void execute(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException {
		request.setCharacterEncoding("euc-kr");
		String MemId= request.getParameter("MemId");
		String Mem_Nm= request.getParameter("MemNm");
		String Mem_Cd= request.getParameter("MemCd");
		String Pwd= request.getParameter("Pwd");
		String Pwd_Hint= request.getParameter("PwdHint");
		String Pwd_Hint_Ans= request.getParameter("PwdHintAns");
		String Tel_No= request.getParameter("TelNo");
		String Cell_No= request.getParameter("CellNo");
		String Addr= request.getParameter("Addr");
		String Email= request.getParameter("Email");
		String Eamil_Rcv_Flg= request.getParameter("EmailRcvFlg");
		System.out.println(Eamil_Rcv_Flg);
		MemDAO mdao = MemDAO.getInstance();
		MemVO vo = new MemVO();
		vo.setMemId(MemId);
	    vo.setMemNm(Mem_Nm);
	    vo.setMemCd(Mem_Cd);
	    vo.setPwd(Pwd);
	    vo.setPwdHint(Pwd_Hint);
	    vo.setPwdHintAns(Pwd_Hint_Ans);
	    vo.setTelNo(Tel_No);
	    vo.setCellNo(Cell_No);
	    vo.setAddr(Addr);
	    vo.setEmail(Email);
	    vo.setEmailRcvFlg(Eamil_Rcv_Flg);
		
		boolean result = mdao.adm_updatemember(vo);
		System.out.println(result);

		HttpUtil.forward(request, response, "list.do");
		
	}

}
